package com.xian;


import java.util.Calendar;

/**
 * @Author: yanjunfeng
 * @Description: TODO
 * @Date: Created in 下午2:48 2022/7/13
 * @Modified By:
 */
public abstract class Employee {
    private String name;//员工姓名
    private int month;//生日月份

    public Employee(String name,int month){
        this.name=name;
        this.month=month;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }


    /**
     * 计算工资
     */
    public abstract double getSalary();

    /**
     * 判断员工当月是否过生日
     * @return
     */
    public double getSalarybyBri(){
       Calendar calendar= Calendar.getInstance();
       int m=calendar.get(Calendar.MONTH)+1;//默认0-11
        if(month==m){
            return 100;
        }else{
            return 0;
        }
    }
}
